package com.ad.pet.app.account;

import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.EditText;

import com.ad.pet.DaggerMainActivityCompent;
import com.ad.pet.R;
import com.ad.pet.common.data.utils.ui.ToastUtil;
import com.ad.pet.common.structure.mvp.BasePresenter;
import com.ad.pet.common.structure.ui.activity.AppToolbarActivity;
import com.ad.pet.models.remote.account.AboutUs;

import javax.inject.Inject;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by liuyixiang on 2019/10/24.
 */

public class SuggestFadeActivity extends AppToolbarActivity implements AboutUsContract.View {
    @Inject
    AboutUsPresenter aboutUsPresenter;
    @BindView(R.id.et_adfa)
    EditText etAdfa;

    @Override
    protected void init(Bundle savedInstanceState) {
        super.init(savedInstanceState);
        mToolbar.setTitle("意见反馈");
        mStatusLayoutManager.showContent();
        mToolbar.setNextText("发送");
        mToolbar.setNextTextColor(mActivity.getResources().getColor(R.color.gray34));
        mToolbar.setNextOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (TextUtils.isEmpty(etAdfa.getText().toString()))
                    return;
                aboutUsPresenter.sendSuggesst(etAdfa.getText().toString());
            }
        });
    }

    @Override
    protected int contentLayout() {
        return R.layout.activity_suggest_fade;
    }

    @Override
    protected void clickRetry(View v) {

    }

    @Override
    protected void initViews() {
        aboutUsPresenter.onCreate(this);

    }

    @Override
    protected void initData() {

    }

    @Override
    protected void initEvents() {

    }

    @Override
    public void initInject() {
        DaggerMainActivityCompent.builder().applicationComponent(getApplicationComponent()).activityModule(getActivityModule()).build().inject(this);
        ;

    }

    @Override
    protected BasePresenter getPresenter() {
        return null;
    }

    @Override
    public void showLoading() {

    }

    @Override
    public void hideLoading() {

    }

    @Override
    public void error(String msg) {

    }

    @Override
    public void error(int code, String msg) {

    }

    @Override
    public void aboutUsSuccess(AboutUs aboutUs) {

    }

    @Override
    public void sendSuggessSuccess() {
        ToastUtil.getToastUtil().showShort("意见反馈发送成功");
        finish();
    }

    @Override
    public void clearAccountSuccess() {

    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // TODO: add setContentView(...) invocation
        ButterKnife.bind(this);
    }



}
